<?php
namespace app\common\behavior;
use app\jok\logic\jokCommonLogic;
use think\Request;
class ApiAuth 
{
    public function run(&$params)
    {
        $header = Request::instance()->header();
        $platform = $header['platform'] ?? 'web';
        $accessToken = $header['Authorization'] ?? '';
        $result = jokCommonLogic::checkToken($platform . '_' . $accessToken);
        if(!$result){
            return json(['code' => -1, 'msg' => 'TOKEN失效,请重新登录']);
        }
    }
}